<?php
	
	function ParentChildSort($data,$pid=0)
	{
		$arr=array();
		foreach($data as $v)
		{
			if($v['parent']==$pid)
			{
				$v['child']=ParentChildSort($data,$v['id']);
				$v['href']=U($v['href']);
				/*********
				if($v['navtype']=="category")
				{
					$v['title']=$v['catename'];
					$v['href']=U('/Sort/index',array('sid'=>$v['href']));
				}elseif($v['navtype']=="page")
				{
					$v['title']=$v['pagename'];
					$v['href']=U('/Article/index',array('bid'=>$v['pageid']));
				}else {
					$v['href']=U('/'.$v['href']);
				}************/
				$arr[]=$v;
			}
		}
		return $arr;
	}
	
	

?>